/*
 * @Author: wcx 1055127249@qq.com
 * @Date: 2025-01-13 17:35:58
 * @LastEditors: wcx 1055127249@qq.com
 * @LastEditTime: 2025-01-14 13:37:38
 * @FilePath: \my-project\src\views\CreateProcess2\node\event.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Graph } from '@antv/x6'
import { createPods } from '../register/ports'
Graph.registerNode('start', {
  width: 40,
  height: 40,
  markup: [
    {
      tagName: 'rect',
      selector: 'body',
    },
    {
      tagName: 'image',
      selector: 'avatar',
    },
    {
      tagName: 'text',
      selector: 'label',
    },
    {
      tagName: 'text',
      selector: 'error',
    },
  ],
  attrs: {
    body: {
      rx: 20,
      ry: 20,
      text: 'rect',
      label: 'rect',
      strokeWidth: 2,
      refWidth: '100%',
      refHeight: '100%',
      stroke: '#5F95FF',
      fill: 'transparent',
      pointerEvents: 'visiblePainted',
    },
    label: {
      x: 20,
      y: 20,
      // text: '开始',
      refWidth: '100%',
      refHeight: '100%',
      fontSize: 12,
      textAnchor: 'middle',
      textVerticalAnchor: 'middle',
    },
    error: {
      x: 1,
      y: 60,
      fill: '#f00',
      fontSize: 12,
      textAnchor: 'start',
      textVerticalAnchor: 'bottom',
    },
  },
  ports: createPods('top', 'left', 'bottom', 'right')
}, true)
Graph.registerNode('end', {
  width: 40,
  height: 40,
  markup: [
    {
      tagName: 'rect',
      selector: 'body',
    },
    {
      tagName: 'text',
      selector: 'label',
    },
    {
      tagName: 'text',
      selector: 'error',
    },
  ],
  attrs: {
    body: {
      rx: 20,
      ry: 20,
      strokeWidth: 2,
      refWidth: '100%',
      refHeight: '100%',
      stroke: '#5F95FF',
      fill: 'transparent',
      pointerEvents: 'visiblePainted',
    },
    label: {
      x: 20,
      y: 20,
      text: '结束',
      refWidth: '100%',
      refHeight: '100%',
      fontSize: 12,
      textAnchor: 'middle',
      textVerticalAnchor: 'middle',
    },
    error: {
      x: 1,
      y: 60,
      fill: '#f00',
      fontSize: 12,
      textAnchor: 'start',
      textVerticalAnchor: 'bottom',
    },
  },
  ports: createPods('top', 'left', 'bottom', 'right')
}, true)